home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Presentations
/
Presentations ’94
/
Timothy Knox
/
Help
/
Help Files
/
Foreign Code
/
Fib-init
< prev
next >
Wrap
Text File
|
1994-06-24
|
921b
|
28 lines
{••• The following expression LOADS the CODE for Fibonnacci as compiled
by Help compiler… then hand-translated to MPW Asm… All the files
from compiler generation to final code are in this directory •••}
;;; ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
;;; ------> PAY ATTENTION TO THE PATH GIVEN in 4th line ! <-----
;;; ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
;;; If it isn't correct, it won't work, and you will get an i/o error
(begin
(define (fib n))
(define xref (force (cell 'fib <? 2 1 + fib 1- - ƒ)))
(define e (getext xref "Fib" ":Help Files:Foreign Code:foreign"))
(coerce fib (type '(a b)))
(car=! fib e)
(cdr=! fib ())
(print fib)
(masgc)
(coerce fib 12)
(setstrict fib %1))
{••• Try it…
Timing is on a MacIntosh emulated on an Amiga 2000 (68030/25Mhz) •••}
(chrono (fib 20))
{ = [10946 1.150000000000000000e+0 0.000000000000000000e+0] }